package cz.muni.fi.pa165.creatures.model.app;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author xmiklos1
 */
public class Main {

    public static void main(String[] args) {
        
        String PERSISTENCE_UNIT_NAME = "CreaturesPU";
        EntityManagerFactory factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
        EntityManager em = factory.createEntityManager();

        em.getTransaction().begin();
        
        // your very basic tests go here
        // implement real tests afterwards
        // leave here this comment if possible to not doing 
        // a mess with a committing
        
        em.getTransaction().commit();
        
/*
        // just for the inspiration

        Weapon weapon = new Weapon();
        weapon.setName("AK-48");
        CreatureType creatureType = new CreatureType("alien", new Integer(10));
        creatureType.setCreaturesInGroup(new Integer(15));
        
        em.persist(creatureType);
        
        CreatureTypeWeaponEffectivity creatureTypeWeaponEffectivity = new CreatureTypeWeaponEffectivity();
        creatureTypeWeaponEffectivity.setWeapon(weapon);
        creatureTypeWeaponEffectivity.setCreatureType(creatureType);
        creatureTypeWeaponEffectivity.setEffectivity(new Float(10));
        
        weapon.getCreatureTypeWeaponEffectivities().add(creatureTypeWeaponEffectivity);
*/
    }
}